import { Column, CreateDateColumn, Entity, PrimaryGeneratedColumn } from "typeorm";

export enum KitTag {
  FORM = 'FORM',
  SEARCH_LIST = 'SEARCH_LIST',
  TABLE = 'TABLE',
  MODAL_FORM = 'MODAL_FORM',
}

export type KitTags = Array<KitTag & string>;

@Entity()
export class Kit {
  @PrimaryGeneratedColumn()
  id: number;

  @Column()
  type: 'kit';

  @Column()
  name: string;

  @Column()
  description: string;

  @Column('simple-array')
  tag: KitTags;

  @Column('longtext')
  content: string;

  @Column({
    nullable: true,
    type: 'longtext'
  })
  imageUrl: string;

  @CreateDateColumn()
  createAt: Date;
}
